<?php


namespace App\Http\Requests\Api;


class ImgDetectRequest extends FormRequest
{
    public function rules()
    {
        switch ($this->method()){
            case 'POST':
            {
                return [
                    'file' => ['required']
                ];
            }
            case 'GET':
            case 'PUT':
            case 'DELETE':
            default:
            {
                return [];
            }
        }
    }

    public function messages()
    {
        return [
            'file.required'=>'图片未上传！',

        ];
    }
}
